package com.ykdl.member.kid.beans;

import java.io.Serializable;
import java.util.Map;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;

import net.wxxr.http.interfaces.IJsonParser;

/**
 * 喂养工具 bean
 * @author Pengfei
 *
 */
public class Feeding extends Nursing {

	public static final int FEEDER_FORMULA_MILK = 1;     // 配方奶
	public static final int FEEDER_BREAST_MILK = 2;      // 母乳

    private int feeding_type; //喂养类型 配方奶/母乳
    private int amount; //总量(ml)
    private int vomits; //有无吐奶
    private int duration; //时间
    private float begin_time; //None #开始时间
    private float end_time; //喝完时间
    
    public Feeding(){}
    
    public Feeding(long id, long actor_id, int nursing_type, float create_time,
			int feeding_type, int amount, int vomits, int duration,
			float begin_time, float end_time) {
		super(id, actor_id, nursing_type, create_time);
		this.feeding_type = feeding_type;
		this.amount = amount;
		this.vomits = vomits;
		this.duration = duration;
		this.begin_time = begin_time;
		this.end_time = end_time;
	}

	public int getFeeding_type() {
		return feeding_type;
	}

	public void setFeeding_type(int feeding_type) {
		this.feeding_type = feeding_type;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public int getVomits() {
		return vomits;
	}

	public void setVomits(int vomits) {
		this.vomits = vomits;
	}

	public int getDuration() {
		return duration;
	}

	public void setDuration(int duration) {
		this.duration = duration;
	}

	public float getBegin_time() {
		return begin_time;
	}

	public void setBegin_time(float begin_time) {
		this.begin_time = begin_time;
	}

	public float getEnd_time() {
		return end_time;
	}

	public void setEnd_time(float end_time) {
		this.end_time = end_time;
	}

	@Override
    public int getNursing_type() {
    	return NURSING_RECORD_TYPE_FEEDING;
    }
    
	@Override
	public IJsonParser parse(String json) throws Exception {
		Gson gson = null;
		if (gson == null) {
			GsonBuilder builder = new GsonBuilder();
			gson = builder.create();
			return gson.fromJson(json, Feeding.class);
		}
		return null;
	}

}
